﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Net.Mime.MediaTypeNames;
using System.Windows.Forms;

namespace WindowsFormsApp_4._8
{
   

    public class OverrideEventButton : Button
    {
        protected override void WndProc(ref Message m)
        {
            if (m.Msg == 513)
            {
                // 鼠标左键被按下
                Text = "按了左键";
            }
            else if (m.Msg == 516)
            {
                Text = "按下右键";
            }
            else
            {
                base.WndProc(ref m);
            }


        }
    }
}
